package com.huli.feign;

import com.huli.param.*;
import com.huli.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@FeignClient("server-user")
public interface UserClient {

    @PostMapping("/user/register")
    Result register(@SpringQueryMap UserRegisterParam registerParam);

    @PostMapping("/user/login")
    Result login(@SpringQueryMap UserLoginParam param);

    @GetMapping("/user/{userId}")
    Result getUser(@PathVariable("userId") int userId);

    @PostMapping("/user/rent")
    Result userRent(@SpringQueryMap OrdersCreateParam param);

    @PostMapping("/user/recharge")
    Result userRecharge();

    @PutMapping("/user")
    Result changeSource(@RequestParam("userId") int userId, @RequestParam("userSource") int userSource);

    @DeleteMapping("/user")
    Result changeStatus();

    @GetMapping("/user/invite")
    Result getUserByInvite(@RequestParam String userInvite);

    @PostMapping("/user/vip")
    Result buyVip(@RequestParam("userId") int userId, @RequestParam("userVipId") int vipId);

    @PutMapping("/user/info")
    Result changeInfo(@SpringQueryMap UserInfoParam userInfoParam);

    @PutMapping("/user/money")
    Result changeMoney(@RequestParam int userId, @RequestParam BigDecimal userMoney);

    @PostMapping("/user/car")
    Result newCar(@SpringQueryMap UserNewCarParam param);

    @GetMapping("/user/car")
    Result getCarList(@RequestParam int userId, @RequestParam int carCheck);

    @GetMapping("/user/car/{carId}")
    Result getUserByCarId(@PathVariable("carId") int carId);

    @DeleteMapping("/user/vip")
    Result changeUserVip();
}
